<!--
*@renewalConfirmation 续贷确认
*@author lijiaqi
*@date 2023/10/17 10:10
-->
<template>
  <div class="pageBox">
    <!--    头部-->
    <x-header :left-options="{backText: ''}"> 续贷确认</x-header>
    <!--    内容部分-->
    <div class="content_box">
      <!--      -->
      <div class="item_box">
        <!--        第一步-->
        <div class="one_box">
          <div class="box_title">
            <p>- 第一步 -</p>
          </div>
          <div class="butt_box" @click="goBackMoney()">
            <p>原合同提前还款</p>
            <x-icon type="ios-arrow-right" size="20"></x-icon>
          </div>
        </div>

        <!--        第二步-->
        <div class="one_box">
          <div class="box_title">
            <p>- 第二步 -</p>
          </div>
          <div class="butt_box" @click="goSignNewContract()">
            <p>签订新合同</p>
            <x-icon type="ios-arrow-right" size="20"></x-icon>
          </div>
        </div>

        <!--        第二步-->
        <div class="one_box" v-if="success" style="color: #F00;">
          <div class="box_title" style="text-align: left;margin-bottom: 10px">
            <p>新合同批复</p>
          </div>
          <p>合同号：00002</p>
          <p style="margin: 3px 0">合同额度：80,000.00元</p>
          <p>合同到期日期：2024年02月03日</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "renewalConfirmation",
  props: {},
  components: {},
  data() {
    return {
      success: false
    }
  },
  computed: {},
  watch: {},
  created() {
    if (this.$route.query.type === 'success') {
      this.showPlugin()
      this.success = true
    }
  },
  mounted() {
  },
  methods: {
    showPlugin() {
      this.$vux.alert.show({
        title: '',
        content: '已续贷成功，请查看新合同',
        onShow() {
          console.log('Plugin: I\'m showing')
        },
        onHide() {
          console.log('Plugin: I\'m hiding now')
        }
      })
    },
    //提前还钱
    goBackMoney() {
      this.$router.push("/refinance/payItBack");
    },
    /**
     * 去签定新合同
     */
    goSignNewContract() {
      this.$router.push("/refinance/contractSigning");
    }
  }
}
</script>

<style lang="less" scoped>
.pageBox {
  min-height: 100vh;
  //中间内容部分
  .content_box {
    width: 100%;
    margin-top: 16px;

    .item_box {
      height: 100%;
      width: 100%;
      background-color: #FFFFFF;

      .one_box {
        width: 80%;
        margin: 0 auto;
        padding: 13px 0;

        .box_title {
          text-align: center;
        }

        .butt_box {
          margin-top: 15px;
          border-radius: 8px;
          border: 1px solid #EEEEEE;
          height: 40px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 0 20px;
        }

        .butt_box:active {
          background-color: #EEEEEE;
        }
      }
    }
  }
}

</style>
